<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>属性和方法</title>
</head>
<body>
<div id="example">
    {{a}}
</div>
<script src="../js/libs/vue.js"></script>
<script>
    var data = { a: 1 };
    var vm = new Vue({
        el: '#example',
        data: data
    });
    console.log(vm.$data === data);
    console.log(vm.$el === document.getElementById('example'));
    //$watch是一个实例方法
    vm.$watch('a', function (newVal, oldVal) {
        //这个回调将在vm.a改变后调用
        console.log('new');
    })
</script>
</body>
</html>